/*
 * Copyright 2019 成都深地领航能源科技有限公司. All rights reserved.
 * PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.sdlh.demo.interfaces;

/**
 * @author 成都深地领航能源科技有限公司
 */
public class InterfaceDemo {
    public static void main(String[] args) {
        ICounter counter = (a, b) -> a + b;
        ICounter.print(counter.transfer(counter.count(5,8)));
        CCounter cCounter = new CCounter();
        ACounter.print(cCounter.transfer(cCounter.count(5, 8)));
        BCounter.print(cCounter.transfer(cCounter.count(4, 8)));
    }
}

class CCounter implements ACounter, BCounter {
    @Override
    public int transfer(int value) {
        return ACounter.super.transfer(value) > BCounter.super.transfer(value) ? ACounter.super.transfer(value) : BCounter.super.transfer(value);
    }

    @Override
    public int count(int a, int b) {
        return a * b;
    }
}